// 7.17.19 Danh sách dự trù mua mớ
import { BasicColumn, BasicTable, FormSchema, useTable } from "@/components/Table";
import { useTranslation } from "react-i18next";
import { WarehouseApi } from "@/api/erp/stock/warehouse";
export default function index() {
	const { t } = useTranslation();
	const schemas: FormSchema[] = [
		{
			label: t(`felix_ui.date_from`),
			field: "date_from",
			component: "DatePicker"
		},
		{
			label: t(`felix_ui.date_to`),
			field: "date_to",
			component: "DatePicker"
		},
		{
			label: t(`felix_ui.department`),
			field: "department",
			component: "Select",
			componentProps: {
				options: [
					{
						label: "暂无字典",
						value: "0"
					}
				]
			}
		},
		{
			label: t("drugStorage.inventoryManagement.drugInventory.warehouseName"),
			field: "whsId",
			component: "ApiSelect",
			componentProps: {
				api: WarehouseApi.getWarehouseSimpleList,
				labelField: "name",
				valueField: "whsId"
			}
		}
	];
	const columns: BasicColumn[] = [
		{
			title: t(`felix_ui.numb_of_sheet`),
			dataIndex: "numb_of_sheet"
		},
		{
			title: t(`felix_ui.dt_date`),
			dataIndex: "dt_date"
		},
		{
			title: t(`felix_ui.department`),
			dataIndex: "department"
		},
		{
			title: t(`drugStorage.inventoryManagement.drugInventory.warehouseName`),
			dataIndex: "warehouseName"
		}
	];
	const getInfo = () => {
		let arr: any = [
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			},
			{
				numb_of_sheet: "adefgsfdda",
				dt_date: "2025/2/25",
				department: "血液科",
				warehouseName: "威朗普"
			}
		];
		return arr;
	};
	const [registerTable] = useTable({
		// api: productApi.getproductPage,
		dataSource: getInfo(),
		columns,
		formConfig: {
			labelWidth: 150,
			labelWrap: true,
			schemas,
			showActionButtonGroup: true,
			showAdvancedButton: false,
			baseColProps: { span: 6 },
			actionColOptions: { span: 24 }
		},
		bordered: true,
		useSearchForm: true
	});
	return (
		<div className="page">
			<BasicTable register={registerTable}></BasicTable>
		</div>
	);
}
